from five import grok
from zope import schema
from plone.directives import form

from zope.interface import Invalid

from plone.namedfile.interfaces import IImageScaleTraversable
from plone.namedfile.field import NamedBlobImage

from plone.app.textfield import RichText

from plumvillage.registration import PlumVillageMessageFactory as _

# Indexer
from plone.indexer import indexer

# Uniqueness validator
from z3c.form import validator
from plone.uuid.interfaces import IUUID
from Products.CMFCore.utils import getToolByName

class IPayment(form.Schema):
    """Describes a payment made on an invoice
    """

    payment = schema.Decimal(
            title=_(u'Payment Made'),
            description=_(u"Payment made in Euros"),
            required=True
        )

class View(grok.View):
    """Default view (called "@@view"") for a payment.
    
    The associated template is found in payment_templates/view.pt.
    """
    
    grok.context(IPayment)
    grok.require('zope2.View')
    grok.name('view')
    
    def update(self):
        """Prepare information for the template
        """
        pass 
